
#import <UIKit/UIKit.h>

@interface UIButton (CountDown)

@property (nonatomic, strong) dispatch_source_t count_down_timer;

- (void)cancelCountdown;

/**
 倒计时按钮

 @param timeout     总时间
 @param waitBlock   倒计时过程中可以再里面做一些操作
 @param finishBlock 完成时执行的block
 */
- (void)startTime:(NSInteger)timeout waitBlock:(void(^)(NSInteger remainTime))waitBlock finishBlock:(void(^)())finishBlock;






/*
 倒计时
 
 @param timeLine    倒计时总时间
 @param title       没到倒计时的title
 @param subString   倒计时中的title
 @param mColor      没到时间的颜色
 @param color       到时间后的颜色
 */
-(void)statrWithTime:(NSInteger)timeLine title:(NSString *)title countDownTitle:(NSString *)subString mainColor:(UIColor *)mColor countColor:(UIColor *)color;

@end
